export function adjust(obj) {
  const { clientWidth, clientHeight } = obj.dom
  const now = new Date().valueOf()

  obj.width = String(clientWidth) + 'px'
  obj.height = String(clientHeight) + 'px'
  obj.flag = now
  obj.observer = new ResizeObserver((e) => {
    const { width, height } = e[0].contentRect
    obj.width = String(width) + 'px'
    obj.height = String(height) + 'px'
    obj.flag = new Date().valueOf()
  })
  if (obj.dom) obj.observer.observe(obj.dom)
}
